package com.xyy.saas.payment.cores.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;

/**
 * 客户数据上送 SendType	上送类型
 */
public enum PinganLoanDataSendTypeEnum {

    PRELOAN("PreLoan", "贷前上送"),
    POSTLOAN("PostLoan", "贷后上送"),
    ;

    private String code;
    private String desc;

    private static Map<String, PinganLoanDataSendTypeEnum> code2Enum;

    static {
        code2Enum = Arrays.asList(values()).stream().collect(Collectors.toMap(PinganLoanDataSendTypeEnum::getCode, UnaryOperator.identity()));
    }

    PinganLoanDataSendTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PinganLoanDataSendTypeEnum getEnum(String code) {
        return code2Enum.get(code);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
